package cn.juni.service.impl;

import cn.juni.dao.IPermissionDao;
import cn.juni.pojo.Permission;
import cn.juni.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * @author Juni
 * @date 2021/2/26
 */
@Service
public class PermissionServiceImpl implements IPermissionService {

    @Autowired
    IPermissionDao permissionDao;

    public List<Permission> findAll() {
        return permissionDao.findAll();
    }

    public int insertPermission(Permission permission) {
        permission.setId(UUID.randomUUID().toString().replace("-",""));
        return permissionDao.insertPermission(permission);
    }
}
